import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
// delon
import {AlainThemeModule} from '@delon/theme';
import {DelonABCModule} from '@delon/abc';
import {DelonChartModule} from '@delon/chart';
import {DelonACLModule} from '@delon/acl';
import {DelonFormModule} from '@delon/form';
// i18n
import {TranslateModule} from '@ngx-translate/core';
// #region third libs
import {NgZorroAntdModule} from 'ng-zorro-antd';
import {CountdownModule} from 'ngx-countdown';
import {UEditorModule} from 'ngx-ueditor';
import {NgxTinymceModule} from 'ngx-tinymce';
import {DictSelectComponent} from '@shared/widgets/dict-select';
import {ImageWrapperComponent} from '@shared/widgets/image-wrapper';
import {UpLoadComponent} from '@shared/widgets/upload';
import {DatePickerComponent} from '@shared/widgets/date-picker';
import {MutiBarChartComponent} from '@shared/widgets/muti-bar-chart';
import {TreeTableComponent} from '@shared/widgets/tree-table';
import {RadioComponent} from '@shared/widgets/radio';
import {TreeSelectComponent} from '@shared/widgets/tree-select';
import {SafePipe} from '@shared/pipe/safe.pipe';
import {DictPipe} from '@shared/pipe/dict.pipe';

const THIRDMODULES = [NgZorroAntdModule, CountdownModule, UEditorModule, NgxTinymceModule];
// #endregion

// #region your componets & directives
const COMPONENTS = [
  DictSelectComponent,
  UpLoadComponent,
  DatePickerComponent,
  ImageWrapperComponent,
  MutiBarChartComponent,
  TreeTableComponent,
  RadioComponent,
  TreeSelectComponent
];
const DIRECTIVES = [];
// #endregion
const PIPES = [
  SafePipe,
  DictPipe,
];
@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    RouterModule,
    ReactiveFormsModule,
    AlainThemeModule.forChild(),
    DelonABCModule,
    DelonChartModule,
    DelonACLModule,
    DelonFormModule,
    // third libs
    ...THIRDMODULES,
  ],
  declarations: [
    // your components
    ...COMPONENTS,
    ...DIRECTIVES,
    ...PIPES,
  ],
  exports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule,
    AlainThemeModule,
    DelonABCModule,
    DelonChartModule,
    DelonACLModule,
    DelonFormModule,
    // i18n
    TranslateModule,
    // third libs
    ...THIRDMODULES,
    // your components
    ...COMPONENTS,
    ...DIRECTIVES,
    ...PIPES,
  ],
})
export class SharedModule {}
